package demo3;

import java.util.ArrayList;

public class char13 {
    public static void main(String[] args) {
        //定义一个集合，添加数字，并进行遍历
        //[元素1,元素2,元素3]
        ArrayList<Integer> number = new ArrayList<>();
        number.add(12);
        number.add(13);
        number.add(14);
        System.out.print("[");
        for (int i = 0; i < number.size(); i++) {
            if(i<number.size()-1){
                System.out.print(number.get(i)+",");
            }else{
                System.out.print(number.get(i));
            }
        }
        System.out.println("]");
    }
}
